<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
	<form class="form-horizontal business-form" id="credit-infoh">
		<div class="current-state-bno">
			<div class="submit-buttonleft">
				<button class="btn-danger-my btn  btn-primary" type="button" id="hcSave" onclick="hcSaveOrUpdate();">保存</button>
				<button style="display: none" class="btn-danger-my btn  btn-primary" type="button" id="hcUpdate" onclick="hcSaveOrUpdate();">修改</button>
			</div>
		</div>
		<input type="hidden" id="hcId" />
		<div class="business-manwife">还车处理</div>
		<div class="padding-nono">
			<table cellpadding="0" cellspacing="0" border="0" class="buyinfor-table">
				<tr>
					<td align="right"><label class="control-label np">还车时间：</label>
					</td>
					<td><input id="hc_time" class="smallicontm form-control" onclick="laydate()" />
					</td>
				</tr>
			</table>
			<table cellpadding="0" cellspacing="0" border="0" class="buyinfor-table">
				<tr>
					<td align="right" valign="top"><label class="control-label np">信息备注：</label>
					</td>
					<td><textarea id="hcRemarks" rows="3" cols="100" class="form-control"></textarea>
					</td>
				</tr>
			</table>
		</div>

		<div class="business-manwife clear-both">经办信息</div>
		<div class="padding-nono">
			<table cellpadding="0" cellspacing="0" border="0"
				class="buyinfor-table">
				<tr>
					<td align="right"><label class="control-label np">经办人：</label> </td>
					<td><input id="hcszOperator" type="text" class="form-control" readonly="readonly" value="${current_user_key.uname}" /></td>
					<td align="right"><label class="control-label np">录入日期：</label> </td>
					<td><input id="hcsz_date" readonly="readonly" type="text" class="form-control" aria-required="true"   />
					</td>
				</tr>
			</table>

		</div>
	</form>
	
	<%@include file="/jsp/comm_js_include.jsp"%>
	<script type="text/javascript">
	 var hcSaveOrUpdate=function(){
     	var data={};
     	var url='${basePath}/DhOverdueReturnController/save';
     	if($("#hcId").val()!=""){
     		data.id=$("#hcId").val();
     		url='${basePath}/DhOverdueReturnController/modify';
     	}else{
	        	data.creatorName=$("#hcszOperator").val();
	        	data.creator="${current_user_key.id}";
	        	data.hccreated=$("#hcsz_date").val();
	        	data.busiId= $.getUrlData("busiId");
	        	data.cusId= $.getUrlData("cusId");
	        	data.overdueId= $.getUrlData("overdueId");
     		
     	}
     	data.timeReturn=$("#hc_time").val();
     	data.remarks=$("#hcRemarks").val();
     	$.dpAjax({
     		show:false,
    		url:url,
    		data:data,
 			success: function(datas){
 				layer.msg('执行成功！', {icon: 6});
				return;
              }
	    });
     }
	 
	 var getHcDataById=function(){
    	var data={};
		data.busiId=$.getUrlData("busiId");
		$.dpAjax({
			show:false,
    		url:'${basePath}/DhOverdueReturnController/list',
			data:data,
 			success: function(datas){
 				  var data=datas.result.rows;
 				  if(data.length>0){
 					  $("#hcId").val(data[0].replaceId);
 					  $("#hc_time").val(data[0].timeReturn);
 					  $("#hcRemarks").val(data[0].remarks);
 					  $("#hcsz_date").val(data[0].hccreated);
					  $("#hcSave").hide();
					  $("#hcUpdate").show();
					  return;
 				  }
             }
	    });
     }
	</script>